﻿using Common.Communal;
using ERP.Domain.CustomerSupplier;
using ERP.Domain.SalesManagement;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Sell.Api.Read.Application.Command.ProcureCommand;
using Sell.DTO;

namespace Sell.Api.Read.Controllers.Procures
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ProcureController : ControllerBase
    {
        private readonly IMediator mediator;
        public ProcureController(IMediator _mediator)
        {
            mediator = _mediator;
        }
        /// <summary>
        /// 采购单列表
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ApiResult<ApiPaging<procurelistdto>>> Procurelist([FromQuery]ProcurelistCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
